
{% extends 'base_main.html' %}

{% block meta %}
  {{ block.super }}
{% endblock %}

{% block title %}
  <title>DDF博客管理系统</title>
{% endblock %}

{% block css %}
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/static/css/style.css">
    <link rel="stylesheet" type="text/css" href="/static/css/login.css">
    <link rel="apple-touch-icon-precomposed" href="/static/images/icon/icon.png">
    <link rel="shortcut icon" href="/static/images/icon/favicon.ico">
{% endblock %}

{% block js %}
    <script src="/static/js/jquery-2.1.4.min.js"></script>
    <script src="/static/js/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="/static/js/html5shiv.min.js" type="text/javascript"></script>
    <script src="/static/js/respond.min.js" type="text/javascript"></script>
    <script src="/static/js/selectivizr-min.js" type="text/javascript"></script>
{% endblock %}

{% block content %}
<div class="container">
    <div class="siteIcon"><img src="/static/images/icon/icon.png" alt="" data-toggle="tooltip" data-placement="top" title="欢迎使用DDF博客管理系统" draggable="false" /></div>
    <p style="color:red;font-size:30px">{{ msg }}</p>
    <form action="" method="post" autocomplete="off" class="form-signin">
        {% csrf_token %}
        <h2 class="form-signin-heading">管理员登录</h2>
        <label for="userName" class="sr-only">用户名</label>
        <input type="text" id="userName" name="username" class="form-control" placeholder="请输入用户名" required autofocus autocomplete="off" maxlength="10">{{ errors.username }}
        <label for="userPwd" class="sr-only">密码</label>
        <input type="password" id="userPwd" name="password" class="form-control" placeholder="请输入密码" required autocomplete="off" maxlength="18">{{ errors.password }}
        <input class="btn btn-lg btn-primary btn-block" type="submit" id="signinSubmit" value="登录">
        <a href="{% url 'user:register' %}">注册</a>
  </form>
    <div class="footer">
        <p><a href="{% url 'user:index' %}" data-toggle="tooltip" data-placement="left" title="不知道自己在哪?">回到后台 →</a></p>
    </div>
</div>
<script src="/static/js/bootstrap.min.js"></script>
<script>
$('[data-toggle="tooltip"]').tooltip();
window.oncontextmenu = function(){
	//return false;
};
$('.siteIcon img').click(function(){
	window.location.reload();
});
$('#signinSubmit').click(function(){
	if($('#userName').val() === ''){
		$(this).text('用户名不能为空');
	}else if($('#userPwd').val() === ''){
		$(this).text('密码不能为空');
	}else{
		$(this).text('请稍后...');
	}
});
</script>
{% endblock %}